package com.ThreadStudy.ThinkingTest;

public class SingletonThread implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName()+"第一个for跑到:--->"+i);
        }

        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName()+"第二个for跑到:--->"+i);
        }


    }


    public static void main(String[] args) {

        SingletonThread singletonThread = new SingletonThread();
        Thread thread = new Thread(singletonThread,"单线程");

        thread.start();


        for (int i = 0; i < 20; i++) {
            System.out.println("主函数第一个for跑-->"+i);
        }



        for (int i = 0;i < 20; i++){
            System.out.println("主函数第二个for跑-->"+i);
        }


    }


}
